package com.lamer.console.common.exception;

import com.lamer.console.common.api.ApiResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(value = ApiException.class)
    public ApiResult<String> handleApiException(ApiException e){
        return ApiResult.failed(e.getMessage());
    }

}
